package com.example.function.integration.service;

import com.example.function.integration.mapper.CrlCreditApplyRecordExtendMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * @description：授信申请数据导出抽象服务接口
 * @className：CreditApplyDataExportService
 * @author：ext.fengcheng
 * @date：2023/9/7 10:26
 */
@Service
public class AbstractDataExportService {

    /**
     * 每次查询50W条
     */
    protected static Long QUERY_PAGE_SIZE = 500000L;
    /**
     * 每个sheet页存放100W条数据
     */
    protected static Long SHEET_NUM = 1000000L;
    /**
     * 存放几个sheet页
     */
    protected static Integer SHEET_PAGE_NUM = 5;
    /**
     * 注入授信申请数据导出任务线程池
     */
    @Resource(name = "initDBExecutor")
    protected ThreadPoolTaskExecutor executor;
    /**
     * 华能授信申请数据导出表头
     */
    protected List<Object> sheetHead = Arrays.asList(
            "序号", "申请流水号", "外部申请流水号", "客户ID", "客户姓名", "客户身份证号", "申请时间", "产品名称", "授信额度", "定价", "状态",
            "是否黑名单", "近180天（非免息）分期消费笔数", "近1年单笔最高消费金额", "近180天信用消费金额", "近180天信用消费笔数", "收入等级",
            "常用手机稳定性", "常用地址稳定性", "有车指数等级", "有房指数等级", "欺诈评分", "手机号使用频繁度", "手机号是否使用过", "履约历史",
            "小白信用等级", "小白信用评分", "其他……");
    @Resource
    protected CrlCreditApplyRecordExtendMapper crlCreditApplyRecordExtendMapper;
    protected static Logger logger = LoggerFactory.getLogger(AbstractDataExportService.class);
}
